package conceptmaps.model;

// Generated Nov 10, 2014 10:58:18 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * User generated by hbm2java
 */
@Entity
@Table(name = "user", catalog = "conceptmapsdb")
public class User implements java.io.Serializable {

	private String idUser;
	private Role role;
	private String password;
	private String fullName;
	private Date dateBirth;
	private Boolean mile;
	private byte[] image;
	private Set<Conceptmaps> conceptmapses = new HashSet<Conceptmaps>(0);
	private Set<Assignment> assignments = new HashSet<Assignment>(0);
	private Set<MemberAssignment> memberAssignments = new HashSet<MemberAssignment>(
			0);
	private Set<Share> shares = new HashSet<Share>(0);
	private Set<Message> messages = new HashSet<Message>(0);
	private Set<Node> nodes = new HashSet<Node>(0);

	public User() {
	}

	public User(String idUser, Role role) {
		this.idUser = idUser;
		this.role = role;
	}

	public User(String idUser, Role role, String password, String fullName,
			Date dateBirth, Boolean mile, byte[] image,
			Set<Conceptmaps> conceptmapses, Set<Assignment> assignments,
			Set<MemberAssignment> memberAssignments, Set<Share> shares,
			Set<Message> messages, Set<Node> nodes) {
		this.idUser = idUser;
		this.role = role;
		this.password = password;
		this.fullName = fullName;
		this.dateBirth = dateBirth;
		this.mile = mile;
		this.image = image;
		this.conceptmapses = conceptmapses;
		this.assignments = assignments;
		this.memberAssignments = memberAssignments;
		this.shares = shares;
		this.messages = messages;
		this.nodes = nodes;
	}

	@Id
	@Column(name = "idUser", unique = true, nullable = false, length = 45)
	public String getIdUser() {
		return this.idUser;
	}

	public void setIdUser(String idUser) {
		this.idUser = idUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "role", nullable = false)
	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Column(name = "password", length = 45)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "fullName", length = 65535)
	public String getFullName() {
		return this.fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dateBirth", length = 10)
	public Date getDateBirth() {
		return this.dateBirth;
	}

	public void setDateBirth(Date dateBirth) {
		this.dateBirth = dateBirth;
	}

	@Column(name = "mile")
	public Boolean getMile() {
		return this.mile;
	}

	public void setMile(Boolean mile) {
		this.mile = mile;
	}

	@Column(name = "image")
	public byte[] getImage() {
		return this.image;
	}

	public void setImage(byte[] image) {
		this.image = image;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Conceptmaps> getConceptmapses() {
		return this.conceptmapses;
	}

	public void setConceptmapses(Set<Conceptmaps> conceptmapses) {
		this.conceptmapses = conceptmapses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Assignment> getAssignments() {
		return this.assignments;
	}

	public void setAssignments(Set<Assignment> assignments) {
		this.assignments = assignments;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<MemberAssignment> getMemberAssignments() {
		return this.memberAssignments;
	}

	public void setMemberAssignments(Set<MemberAssignment> memberAssignments) {
		this.memberAssignments = memberAssignments;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Share> getShares() {
		return this.shares;
	}

	public void setShares(Set<Share> shares) {
		this.shares = shares;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Message> getMessages() {
		return this.messages;
	}

	public void setMessages(Set<Message> messages) {
		this.messages = messages;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Node> getNodes() {
		return this.nodes;
	}

	public void setNodes(Set<Node> nodes) {
		this.nodes = nodes;
	}

}
